<%! func Index(w http.ResponseWriter,r *http.Request) error %>

<%% import "github.com/infinitbyte/framework/modules/ui/common" %%>
<%% import "net/http" %%>

<% common.Head(w, "Dashboard","") %>
<link rel="stylesheet" href="/static/assets/css/tasks.css" />
<script src="/static/assets/js/jquery.sparkline.min.js"></script>
<script src="/static/assets/js/jquery.timeago.js"></script>
<script src="/static/assets/js/page/tasks.js"></script>

<META HTTP-EQUIV="refresh" CONTENT="0;URL=/admin/console/">

<% common.Body(w) %>
<% common.Nav(w,r,"Dashboard") %>



<div class="tm-middle">
    <div class="uk-container uk-container-center">

        <div class="uk-width-1-1 uk-alert">
            <div class="uk-grid">
                <div class="uk-width-1-2">Checker: <span id="checker_task_num">N/A</span> <span class="dynamicsparkline">Loading..</span></div>
                <div class="uk-width-1-2">Crawler: <span id="crawler_task_num">N/A</span> <span class="dynamicbar">Loading..</span></div>
            </div>
        </div>
        <!--<a href="#my-id" data-uk-modal>...</a>-->

        <!--&lt;!&ndash; This is the modal &ndash;&gt;-->
        <!--<div id="my-id" class="uk-modal">-->
            <!--<div class="uk-modal-dialog uk-modal-dialog-blank">...</div>-->
        <!--</div>-->

        <div class="uk-grid" data-uk-grid-margin>
            <div class="uk-width-1-1">


                <table id="tasks" class="uk-table uk-table-hover uk-table-striped" cellspacing="0" width="100%">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>Path</th>
                        <th>Title</th>
                        <th>Size</th>
                        <th>Updated</th>
                    </tr>
                    </thead>
                    <tbody id="records">
                    </tbody>
                </table>



            </div>
        </div>

    </div></div>

<script src="/static/assets/js/page/index.js"></script>
<script type="text/javascript">
     /* Sparklines can also take their values from the first argument
     passed to the sparkline() function */
    var myvalues = [10,8,5,7,4,4,1];
    $('.dynamicsparkline').sparkline(myvalues);

    /* The second argument gives options such as chart type */
    $('.dynamicbar').sparkline(myvalues, {type: 'bar', barColor: 'green'} );


    pointData=[1,2,3,4,5,4,3,2,1,1,2,3,4,5,4,3,2,1,1,2,3,4,5,4,3,2,1,1,2,3,4,5,4,3,2,1];
    $(function() {

        var sparklineLogin = function() {
            $('.sparklines').sparkline(
                    [ pointData ],
                    {
                        type: 'line',
                        width: '100%',
                        height: '25'
                    }
            );
        };
        var sparkResize;

        $(window).resize(function(e) {
            clearTimeout(sparkResize);
            sparkResize = setTimeout(sparklineLogin, 500);
        });
        sparklineLogin();
    });
</script>

<% common.Footer(w) %>
